package com.ruoyi.customer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.customer.mapper.CrmCustomerRecordMapper;
import com.ruoyi.customer.domain.CrmCustomerRecord;
import com.ruoyi.customer.service.ICrmCustomerRecordService;

/**
 * 客户跟进记录Service业务层处理
 * 
 * @author hct
 * @date 2022-04-14
 */
@Service
public class CrmCustomerRecordServiceImpl implements ICrmCustomerRecordService 
{
    @Autowired
    private CrmCustomerRecordMapper crmCustomerRecordMapper;

    /**
     * 查询客户跟进记录
     * 
     * @param id 客户跟进记录主键
     * @return 客户跟进记录
     */
    @Override
    public CrmCustomerRecord selectCrmCustomerRecordById(Long id)
    {
        return crmCustomerRecordMapper.selectCrmCustomerRecordById(id);
    }

    /**
     * 查询客户跟进记录列表
     * 
     * @param crmCustomerRecord 客户跟进记录
     * @return 客户跟进记录
     */
    @Override
    public List<CrmCustomerRecord> selectCrmCustomerRecordList(CrmCustomerRecord crmCustomerRecord)
    {
        return crmCustomerRecordMapper.selectCrmCustomerRecordList(crmCustomerRecord);
    }

    /**
     * 新增客户跟进记录
     * 
     * @param crmCustomerRecord 客户跟进记录
     * @return 结果
     */
    @Override
    public int insertCrmCustomerRecord(CrmCustomerRecord crmCustomerRecord)
    {
        crmCustomerRecord.setCreateTime(DateUtils.getNowDate());
        return crmCustomerRecordMapper.insertCrmCustomerRecord(crmCustomerRecord);
    }

    /**
     * 修改客户跟进记录
     * 
     * @param crmCustomerRecord 客户跟进记录
     * @return 结果
     */
    @Override
    public int updateCrmCustomerRecord(CrmCustomerRecord crmCustomerRecord)
    {
        return crmCustomerRecordMapper.updateCrmCustomerRecord(crmCustomerRecord);
    }

    /**
     * 批量删除客户跟进记录
     * 
     * @param ids 需要删除的客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerRecordByIds(Long[] ids)
    {
        return crmCustomerRecordMapper.deleteCrmCustomerRecordByIds(ids);
    }

    /**
     * 删除客户跟进记录信息
     * 
     * @param id 客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerRecordById(Long id)
    {
        return crmCustomerRecordMapper.deleteCrmCustomerRecordById(id);
    }
}
